package page.ineffable.photostorage.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import page.ineffable.photostorage.mapper.UserMapper;
import page.ineffable.photostorage.pojo.User;
import page.ineffable.photostorage.service.UserService;

/**
 * 用户服务接口实现
 *
 * @author lqs2
 * @date 2018/10/29, Mon
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class UserServiceImpl implements UserService {

    private final UserMapper userMapper;

    @Autowired
    public UserServiceImpl(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public User hasMatchUser(String username, String password) {
        return userMapper.hasMatchUser1(username, password);
    }

    @Override
    public User hasMatchUser(String username) {
        return userMapper.hasMatchUser2(username);
    }
}
